In [141]:
from IPython.display import display, Markdown
def latexify(x):
    out = '$' + x + '$'
    return out

def lprint(x):
    display(Markdown(latexify(latex(x))))

Higher dimensional bifurcation theory

Now we will formulate a harder multidimensional example and try to find it's bifurcation points

Lets make a more complicated multivariable function to try to apply bifurcation theory to

Setting up the problem

We aim to get a spiral bifurcation: use this equation https://www.desmos.com/calculator/di2adchd7a,

Derived by unpacking the tan definition for the Archimedian spiral

In [142]:
var('x y')
var('l', latex_name=r'\lambda')
f = (x^2 + y^2)*(x*sin(sqrt(x^2 + y^2 + 1)) - y*cos(sqrt(x^2 + y^2 + 1)) + 5*sin(l)) # +1s in sqrt to make it smooth
lprint(f)

$ -{\left(x^{2} + y^{2}\right)} {\left(y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right) - x \sin\left(\sqrt{x^{2} + y^{2} + 1}\right) - 5 \, \sin\left({\lambda}\right)\right)} $

Essentially the solution set at for any fixed $\lambda$ is an "offset spiral", when $\lambda = \pi k$ we have a spiral that passes through the origin, we intend for these to become bifurcation points, we add a factor fo $x^2 + y^2$ to introduce the trivial zeros.

In [143]:
implicit_plot3d(f, (-5, 5), (-5,5), (-5,5), opacity = 0.75) + plot3d(0 ,  (-5, 5), (-0.1,0.1), color = 'black')
Out[143]:

But now we see a problem, as a $f: \mathbb{R}^3 \rightarrow \mathbb{R}$, we expect the zero set to be locally a 2-dimensional manifold, by the implicit function theorem.

Technically, viewing $f$ as $f: \mathbb{R}^2 \times \mathbb{R} \rightarrow \mathbb{R}$, provided that $Df_{k} : \mathbb{R} \rightarrow \mathbb{R}$ is an isomorphism then local the zero set can be paramaterised by the other two variables, inducing a manifold.

Here the choice of variable $k$ is deliberately vague, since we can assume it to be either $x$, $y$ or $\lambda$. So we can reason that the zero set is locally a 2-manifold unless $\partial_{x}, \partial_{y}, \partial{\lambda}$ are all zero, hence the linear map style derivative is not an isomorphism $\mathbb{R} \rightarrow \mathbb{R}$

We will be interested in points where $\lambda = \pi k$, and so $\partial_{\lambda} f = -5 \cos(\lambda) = \pm 1$, so already we have that the solution set is locally a 2-manifold.

This means that our local bifurcation theory is invalid, since we look for solutions that bifurcate out as single dimensional manifolds

We see that this is not a quality specific to the choice of function $f$, but rather a symption of the dimensionality of our system. One equation in three unknowns will usually lead to a "two dimensional" set of solutions.

In fact there is another unavoidable reason we cannot apply the bifurcation theory set up in bt_global. To see why we need to consider Fredholm indices.

Denoting $X = \mathbb{R}^2$, we see that

$$f : \mathbb{R} \times X \rightarrow Y (=\mathbb{R})$$

and

$$ L = \partial_{x}F \in \mathcal{L}(X,Y)$$

i.e,

$$ L \in \mathcal{L}(\mathbb{R}^2, \mathbb{R}) $$

Computing the Fredholm index of $\mathcal{L}$

$$\text{ind} \mathcal{L} = \text{dim}\; \text{ker} \mathcal{L} - \text{codim} \; \text{ran} \mathcal{L}$$

Casewise this is:

$$\text{ind} \mathcal{L} = 2 - 1 = 1 $$$$\text{ind} \mathcal{L} = 1 - 0 = 1 $$

We can't have a zero dimensional kernel by the Rank-Nullity theorem

Either way, $\mathcal{L}$ does not have Fredholm index zero, and as such all of our theory is invalid. Luckily there is an easy fix: decrease the Fredholm index, i.e increase the dimension of the codomain, i.e add another equation

In [256]:
g = x*sin(sqrt(x^2 + y^2 + 1)) - y*cos(sqrt(x^2 + y^2 + 1))
lprint(g)

$ -y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right) + x \sin\left(\sqrt{x^{2} + y^{2} + 1}\right) $

In [258]:
implicit_plot3d(g, (-5, 5), (-5,5), (-5,5), opacity = 0.75) b
Out[258]:

Here the black line should be running parallel to the curve, removing the dependency on $\lambda$ means that this zero set will intersect the other at an angle

In [276]:
implicit_plot3d(f, (-5, 5), (-5,5), (-5,5), opacity = 0.75) + implicit_plot3d(g, (-5, 5), (-5,5), (-5,5), opacity = 0.75, color = 'red') + plot3d(0 ,  (-1, 1), (-0.01,0.01), color = 'black')
Out[276]:
In [277]:
implicit_plot3d(f, (-2, 2), (-2,2), (-2,2), opacity = 0.75) + implicit_plot3d(g, (-2, 2), (-2,2), (-2,2), opacity = 0.75, color = 'red') + plot3d(0 ,  (-1, 1), (-0.01,0.01), color = 'black')
Out[277]:

This will make the zero set a bit more interesting.

Finally lets add another variable that has no bearing on the bifurcations, to see how these tie in with the theory, this also lets us ensure that the trivial solution set is preserved when we add in these planar intersections.

In [278]:
var('z')
Out[278]:
z
In [279]:
f1 = (x^2 + y^2)*(x*sin(sqrt(x^2 + y^2 + 1)) - y*cos(sqrt(x^2 + y^2 + 1)) + 5*sin(l)) # now zeros out because of z multiple
f2 = x*sin(sqrt(x^2 + y^2 + 1)) - y*cos(sqrt(x^2 + y^2 + 1)) # add z to help out the derivatives
f3 = 2*z
lprint(f1)
lprint(f2)
lprint(f3)

$ -{\left(x^{2} + y^{2}\right)} {\left(y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right) - x \sin\left(\sqrt{x^{2} + y^{2} + 1}\right) - 5 \, \sin\left({\lambda}\right)\right)} $

$ -y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right) + x \sin\left(\sqrt{x^{2} + y^{2} + 1}\right) $

$ 2 \, z $

Now we see that:

$$f: \mathbb{R}^4 \rightarrow \mathbb{R}^3$$

And will have Fredholm index 0 partials (of $X = \mathbb{R}^3$) we introduced $z$ in a way so that the solution set resides in the "slice" where $z = 0", perhaps we also have introduced more solutions, but for now we will focus on the constructed bifurcation points.

We will consider:

$$ f : \mathbb{R}^3 \times \mathbb{R} \rightarrow \mathbb{R}^3$$

Where the single dimensional $\mathbb{R}$ is the dimension parametrised by $\lambda$

Doing the bifurcation theory

By inspection we see that we have make smooth functions, now we claim that $\lambda = \pi k$ is a bifurcation point for $k \in \mathbb{Z}$

Lets first just consider $\lambda_{0} = 0$

We will follow the notational convention in btglobal and refer to the space $\mathbb{R}^3$ spanned by $(x,y,z)$ as $X$, the point $(\lambda{0}, 0, 0, 0)$ becoming $(\lambda_{0}, 0)$

Now we need to compute:

$$ \mathcal{L} = \partial_{x}[(\lambda_{0}, 0)]$$

We see that $\mathcal{L} \in \mathcal{L}(\mathbb{R}^3, \mathbb{R}^3)$

Sage doesn't do matrix style derivatives, but we can construct this without too much difficulty:

In [280]:
lprint(f1.diff(x))
lprint(f1.diff(y))
lprint(f1.diff(z))

$ {\left(\frac{x^{2} \cos\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} + \frac{x y \sin\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} + \sin\left(\sqrt{x^{2} + y^{2} + 1}\right)\right)} {\left(x^{2} + y^{2}\right)} - 2 \, {\left(y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right) - x \sin\left(\sqrt{x^{2} + y^{2} + 1}\right) - 5 \, \sin\left({\lambda}\right)\right)} x $

$ {\left(\frac{x y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} + \frac{y^{2} \sin\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} - \cos\left(\sqrt{x^{2} + y^{2} + 1}\right)\right)} {\left(x^{2} + y^{2}\right)} - 2 \, {\left(y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right) - x \sin\left(\sqrt{x^{2} + y^{2} + 1}\right) - 5 \, \sin\left({\lambda}\right)\right)} y $

$ 0 $

In [281]:
lprint(f1.diff(x)(0,0,0)) # z was killed off so sage only wants three inputs
lprint(f1.diff(y)(0,0,0))
lprint(f1.diff(z))

$ 0 $

$ 0 $

$ 0 $

In [282]:
lprint(f2.diff(x)) # z was killed off so sage only wants three inputs
lprint(f2.diff(y))
lprint(f2.diff(z))

$ \frac{x^{2} \cos\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} + \frac{x y \sin\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} + \sin\left(\sqrt{x^{2} + y^{2} + 1}\right) $

$ \frac{x y \cos\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} + \frac{y^{2} \sin\left(\sqrt{x^{2} + y^{2} + 1}\right)}{\sqrt{x^{2} + y^{2} + 1}} - \cos\left(\sqrt{x^{2} + y^{2} + 1}\right) $

$ 0 $

In [283]:
lprint(f2.diff(x)(0,0)) # z was killed off so sage only wants three inputs
lprint(f2.diff(y)(0,0))
lprint(f2.diff(z))

$ \sin\left(1\right) $

$ -\cos\left(1\right) $

$ 0 $

In [284]:
lprint(f3.diff(x)) 
lprint(f3.diff(y))
lprint(f3.diff(z))

$ 0 $

$ 0 $

$ 2 $

In [285]:
lprint(f3.diff(x)) 
lprint(f3.diff(y))
lprint(f3.diff(z))

$ 0 $

$ 0 $

$ 2 $

In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]: